﻿<sap:ActivityDesigner x:Class="WFDataBaseProject.UCExecuteBulkCopyActivityDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:helpers="clr-namespace:WFDataBaseProject.Helpers"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation">
    <sap:ActivityDesigner.Resources>
        <sapc:ArgumentToExpressionConverter x:Key="argumentToExpressionConverter"/>
        <!--Expanded-->
        <DataTemplate x:Key="expanded">
            <StackPanel Orientation="Vertical">
                <!--Connection string-->
                <TextBlock Text="Connection string: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the connection string"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.ConnectionString,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>
                <!--Connection type-->
                <TextBlock Text="Connection type(TypeOfConnection): "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the connection type"
                                ExpressionType="{x:Type helpers:TypeOfConnection}"
                                Expression="{Binding ModelItem.ConnectionType,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>
                <!--Returned type-->
                <TextBlock Text="Returned type(TypeOfReturn): "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the returned type"
                                ExpressionType="{x:Type helpers:TypeOfReturn}"
                                Expression="{Binding ModelItem.ReturnedType,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>
                <!--Source location-->
                <TextBlock Text="Source location(SqlSourceLocation): "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the source location"
                                ExpressionType="{x:Type helpers:SqlSourceLocation}"
                                Expression="{Binding ModelItem.SourceLocation,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>
                <!--Destination connection string-->
                <TextBlock Text="Destination connection string: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the destination connection string"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.DestinationConnectionString,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>
                <!--Destination table-->
                <TextBlock Text="Destination table: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the destination table"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.DestinationTable,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>
                <!--Qurey-->
                <TextBlock Text="Query: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="enter the query"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.Query,Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},ConverterParameter=In}"/>

            </StackPanel>
        </DataTemplate>
        <!--Collapsed-->
        <DataTemplate x:Key="collapsed">
            <TextBlock Text="Collapsed mode"/>
        </DataTemplate>
        <!--Style for activity designer-->
        <Style x:Key="displaymodestyle" TargetType="{x:Type ContentPresenter}">
            <Setter Property="ContentTemplate" Value="{DynamicResource expanded}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=ShowExpanded}" Value="false">
                    <Setter Property="ContentTemplate" Value="{DynamicResource collapsed}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </sap:ActivityDesigner.Resources>
    <Grid>
        <ContentPresenter Style="{DynamicResource displaymodestyle}" Content="{Binding}" />
    </Grid>
</sap:ActivityDesigner>
